import request from '@/utils/request'


//list
export function downLoadAnswer(query) {
    return request({
        url: 'tools-downloadanswer/downLoadAnswerList',
        method: 'get',
        params: query
    })
}

// 下载进度
export function downLoadProgress(query) {
    return request({
        url: 'tools-downloadanswer/getDownLoadProgress',
        method: 'get',
        params: query
    })
}

// 答案校验
export function checkFormalAnswer() {
  return request({
      url: 'tools-detection/checkFormalAnswer',
      method: 'get',
  })
}

// 判断状态（收到命令开始运行或者正在运行中）
export function statusAnswer(subjectIndex, testSession) {
    return request({
        url: `tools-downloadanswer/saveAnswer/${subjectIndex}/${testSession}`,
        method: 'post',
    })
}

// 一键操作 - 1 - 合并数据
export function unionFormalAnswer() {
  return request({
    url: '/tools-downloadanswer/unionFormalAnswer',
    method: 'get',
  })
}

// 一键操作 - 2.0 - mq相关操作
export function cleanRedundantMq() {
  return request({
    url: '/tools-downloadanswer/cleanRedundantMq',
    method: 'get',
  })
}

// 一键操作 - 2.1 - 点确定的时候调这个，点取消的时候调用第3步
export function cleanUpOldData() {
  return request({
    url: '/tools-downloadanswer/cleanUpOldData',
    method: 'delete',
  })
}

// 一键操作 - 3 - 获取异常列表
export function listUnAssemblyData() {
  return request({
    url: '/tools-downloadanswer/listUnAssemblyData',
    method: 'get',
  })
}

// 一键操作 - 4 - 修改数据
export function updateAnswerFromMq() {
  return request({
    url: '/tools-downloadanswer/updateAnswerFromMq',
    method: 'get',
  })
}

// 获取是否完成
// unionFormalAnswer 接口传1
// CleanRedundantMq 接口传2
// updateAnswerFromMq 接口传4
export function getStepStatus(step) {
  return request({
    url: `/tools-downloadanswer/getStepStatus/${step}`,
    method: 'get',
  })
}

// 答案扶正
export function updateFormalAnswer() {
  return request({
    url: '/tools-detection/updateFormalAnswer',
    method: 'get',
  })
}
